package com.umerclass.frame.ui.recycleview.listener;

import android.view.View;

import java.util.Date;

/**
 * Created by jack
 *
 */

public abstract class NoDoubleClickListener implements View.OnClickListener {

    public static final int MIN_CLICK_DELAY_TIME = 1000;
    private long lastClickTime = 0;


    @Override
    public void onClick(View v) {
        long currentTime = (new Date()).getTime();
        if (currentTime - lastClickTime > MIN_CLICK_DELAY_TIME) {
            lastClickTime = currentTime;
            onNoDoubleClick(v);
        }
    }
    protected abstract void onNoDoubleClick(View v);

}